import numpy as np

C = np.array([0, 18.7, 53, 82, 80, 168, 280, 520]).reshape(-1, 1)  # 养护措施j的单价
E = np.array([0, 0.23, 0.8, 0.92, 1.44, 1.54, 1.60, 1.64]).reshape(-1, 1)  # 养护措施j的碳排放

sfc = np.random.randint(0, 16, (20, 1))
print(sfc)
xxx = sfc <= 3
sfc[sfc<=3]=0
sfc[(sfc>3) & (sfc<=5)]=1
sfc[(sfc>5) & (sfc<=8)]=2
sfc[(sfc>8) & (sfc<=10)]=3
sfc[(sfc>10) & (sfc<=15)]=4
sfc[sfc>15]=5
# print(sfc)
# sfc[sfc>90]=0
# x = x[x>=60 and x <90]=1
print(sfc)
# print(x)

j = sfc.copy()
print(j)
Cj = C[j].squeeze(-1)
print('Cj: {}'.format(Cj))


